package com.econ.powercloud.ems.domain;

import com.econ.powercloud.common.base.facade.util.JacksonUtil;
import com.econ.powercloud.ems.dal.entity.EmsPeakShift;
import com.econ.powercloud.ems.pojo.EmsPeakShiftVO;
import com.econ.powercloud.ems.pojo.requestVO.EmsPeakShiftRequestVO;

import java.util.List;

/**
 * @author zjr
 * @create 2021/7/22 下午2:23
 * @description
 */
public class EmsPeakShiftDO {
    /**
     * 集合：实体类->VO类
     * @param emsPeakShifts
     * @return
     */
    public static List<EmsPeakShiftVO> entityListToVOList(List<EmsPeakShift> emsPeakShifts){
        List<EmsPeakShiftVO> emsPeakShiftVOS = JacksonUtil.convertToList(emsPeakShifts, EmsPeakShiftVO.class);
        return emsPeakShiftVOS;
    }

    /**
     * RequestVO->实体类
     * @param emsPeakShiftRequestVO
     * @return
     */
    public static EmsPeakShift requestVOToEntity(EmsPeakShiftRequestVO emsPeakShiftRequestVO){
        return JacksonUtil.convertToObj(emsPeakShiftRequestVO, EmsPeakShift.class);
    }
}
